package com.example.mybatisplusdemo.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.example.mybatisplusdemo.model.domain.BookingTrack;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

@Mapper
public interface BookingTrackMapper extends BaseMapper<BookingTrack> {

    @Select("SELECT * FROM booking_track WHERE tracking_id = #{trackingId}")
    BookingTrack selectByTrackingId(String trackingId);

    @Update("UPDATE booking_track SET status = #{status}, update_time = NOW() WHERE tracking_id = #{trackingId}")
    int updateStatusByTrackingId(@Param("trackingId") String trackingId, @Param("status") String status);
}